﻿using UnityEngine;
using UnityEngine.UI;
public static class ReferenceCollectorHelper
{
    public static Button GetButton(this ReferenceCollector collector, string key)
    {
        return collector.Get<GameObject>(key).GetComponent<Button>();
    }
    public static Text GetText(this ReferenceCollector collector, string key)
    {
        return collector.Get<GameObject>(key).GetComponent<Text>();
    }
    public static Slider GetSlider(this ReferenceCollector collector, string key)
    {
        return collector.Get<GameObject>(key).GetComponent<Slider>();
    }
    public static InputField GetInputField(this ReferenceCollector collector, string key)
    {
        return collector.Get<GameObject>(key).GetComponent<InputField>();
    }
    public static Image GetImage(this ReferenceCollector collector, string key)
    {
        return collector.Get<GameObject>(key).GetComponent<Image>();
    }

    public static RawImage GetRawImage(this ReferenceCollector collector, string key)
    {
        return collector.Get<GameObject>(key).GetComponent<RawImage>();
    }

    public static Toggle GetToggle(this ReferenceCollector collector, string key)
    {
        return collector.Get<GameObject>(key).GetComponent<Toggle>();
    }
    public static Scrollbar GetScrollbar(this ReferenceCollector collector, string key)
    {
        return collector.Get<GameObject>(key).GetComponent<Scrollbar>();
    }
    public static Dropdown GetDropdown(this ReferenceCollector collector, string key)
    {
        return collector.Get<GameObject>(key).GetComponent<Dropdown>();
    }
    public static ScrollRect GetScrollRect(this ReferenceCollector collector, string key)
    {
        return collector.Get<GameObject>(key).GetComponent<ScrollRect>();
    }

    public static GameObject GetGameObject(this ReferenceCollector collector, string key)
    {
        return collector.Get<GameObject>(key);
    }

    public static T GetGameObject<T>(this ReferenceCollector collector, string key)
    {
        return collector.Get<GameObject>(key).GetComponent<T>();
    }
    public static Transform GetTransform(this ReferenceCollector collector, string key)
    {
        return collector.Get<GameObject>(key).transform;
    }

}